package com.arcsoft.commonbase.ext


import com.flyco.tablayout.CommonTabLayout
import com.flyco.tablayout.listener.OnTabSelectListener

/**
 * 优化输入框，可以只设置afterTextChanged回调
 */
fun CommonTabLayout.onTabSelect(onTabSelect: (Int) -> Unit) {

    this.setOnTabSelectListener(object : OnTabSelectListener {
        override fun onTabSelect(position: Int) {
            onTabSelect.invoke(position)
        }

        override fun onTabReselect(position: Int) {

        }

    })
}